/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Admin
 */
@Entity
@Table(name = "AccountInformation", catalog = "AAL", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "AccountInformation.findAll", query = "SELECT a FROM AccountInformation a"),
    @NamedQuery(name = "AccountInformation.findById", query = "SELECT a FROM AccountInformation a WHERE a.id = :id"),
    @NamedQuery(name = "AccountInformation.findByFirstName", query = "SELECT a FROM AccountInformation a WHERE a.firstName = :firstName"),
    @NamedQuery(name = "AccountInformation.findByLastName", query = "SELECT a FROM AccountInformation a WHERE a.lastName = :lastName"),
    @NamedQuery(name = "AccountInformation.findByEmail", query = "SELECT a FROM AccountInformation a WHERE a.email = :email"),
    @NamedQuery(name = "AccountInformation.findByAddress", query = "SELECT a FROM AccountInformation a WHERE a.address = :address"),
    @NamedQuery(name = "AccountInformation.findByPhone", query = "SELECT a FROM AccountInformation a WHERE a.phone = :phone"),
    @NamedQuery(name = "AccountInformation.findByApproved", query = "SELECT a FROM AccountInformation a WHERE a.approved = :approved"),
    @NamedQuery(name = "AccountInformation.findByBirthday", query = "SELECT a FROM AccountInformation a WHERE a.birthday = :birthday")})
public class AccountInformation implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID", nullable = false)
    private Integer id;
    @Column(name = "FirstName", length = 50)
    private String firstName;
    @Column(name = "LastName", length = 100)
    private String lastName;
    @Column(name = "Email", length = 200)
    private String email;
    @Column(name = "Address", length = 200)
    private String address;
    @Column(name = "Phone", length = 20)
    private String phone;
    @Column(name = "Approved")
    private Short approved;
    @Column(name = "Birthday")
    @Temporal(TemporalType.TIMESTAMP)
    private Date birthday;
    @JoinColumn(name = "AccountID", referencedColumnName = "ID")
    @ManyToOne
    private Account accountID;

    public AccountInformation() {
    }

    public AccountInformation(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Short getApproved() {
        return approved;
    }

    public void setApproved(Short approved) {
        this.approved = approved;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public Account getAccountID() {
        return accountID;
    }

    public void setAccountID(Account accountID) {
        this.accountID = accountID;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AccountInformation)) {
            return false;
        }
        AccountInformation other = (AccountInformation) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.AccountInformation[id=" + id + "]";
    }

}
